Migrate to Java 25#71
Draft
patrick-vuong with Copilot wants to merge 3 commits into
Draft
Conversation
Agent-Logs-Url: https://github.com/moderneinc/yet-another-dropwizard-service/sessions/1d0fd12e-490c-4a76-ae9d-5794bbdcc63d Co-authored-by: patrick-vuong <107423518+patrick-vuong@users.noreply.github.com>
Changes applied by the migration recipe: - Update Maven compiler source/target/release from 11 to 25 - Upgrade maven-compiler-plugin to 3.15.0 - Upgrade maven-surefire-plugin and maven-failsafe-plugin to 3.5.5 - Add JVM --add-opens args for test execution compatibility - Modernize code: switch expressions, pattern matching instanceof, unnamed catch variables, String.formatted(), instance main method - Update CI workflow to use JDK 25 Agent-Logs-Url: https://github.com/moderneinc/yet-another-dropwizard-service/sessions/1d0fd12e-490c-4a76-ae9d-5794bbdcc63d Co-authored-by: patrick-vuong <107423518+patrick-vuong@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR migrates the service build and CI from Java 11 to Java 25 and applies a set of automated Java language modernizations generated via OpenRewrite.
Changes:
- Updated Maven compiler/test plugin configuration and CI workflow to build/test using JDK 25.
- Refactored several Java code paths to newer language/library constructs (pattern matching
instanceof, switch expression,String::formatted, unnamed catch variables). - Updated internal Moderne/OpenRewrite runbook text to reference different MCP tooling names.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/org/ministry/magic/WizardRegistryApplication.java | Changes the application entrypoint method signature to an instance main. |
| src/main/java/org/ministry/magic/service/WizardService.java | Modernizes instanceof usage and replaces a switch statement with a switch expression. |
| src/main/java/org/ministry/magic/service/WizardAuthService.java | Replaces String.format with String.formatted in hash hex rendering. |
| src/main/java/org/ministry/magic/resources/WizardResource.java | Uses unnamed catch variable _ for invalid status parsing. |
| pom.xml | Updates compiler/test plugin versions and config; sets Java release to 25; adds test JVM --add-opens args. |
| .github/workflows/ci.yml | Updates CI to run with Temurin JDK 25. |
| .github/instructions/moderne-run-recipe.instructions.md | Updates documentation wording/tool references for Moderne recipe discovery. |
Comments suppressed due to low confidence (1)
pom.xml:183
- Failsafe’s
argLineduplicates the Surefire JVM args (same--add-opensand ByteBuddy flag). Centralizing these JVM args in a shared property (and reusing it in both plugins) will reduce maintenance risk when these flags need to change again.
<configuration>
<argLine>--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/jdk.internal.misc=ALL-UNNAMED --add-opens java.base/jdk.internal.reflect=ALL-UNNAMED -Dnet.bytebuddy.experimental=true</argLine>
</configuration>
| public class WizardRegistryApplication extends Application<WizardRegistryConfiguration> { | ||
|
|
||
| public static void main(String[] args) throws Exception { | ||
| void main(String[] args) throws Exception { |
| return "Registry message: " + msg; | ||
| } else if (event instanceof List) { | ||
| List list = (List) event; | ||
| } else if (event instanceof List list) { |
Comment on lines
163
to
167
| <excludes> | ||
| <exclude>**/*IT.java</exclude> | ||
| </excludes> | ||
| <argLine>-Dnet.bytebuddy.experimental=true</argLine> | ||
| <argLine>-Dnet.bytebuddy.experimental=true --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/jdk.internal.misc=ALL-UNNAMED --add-opens java.base/jdk.internal.reflect=ALL-UNNAMED</argLine> | ||
| </configuration> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrate project from Java 11 to Java 25 using OpenRewrite
UpgradeToJava25recipe.Build
maven-compiler-plugin3.11.0 → 3.15.0maven-surefire-plugin/maven-failsafe-plugin3.2.2 → 3.5.5--add-opensJVM args for ByteBuddy/Mockito reflection access in testsCode modernizations
getHouseDescription()rewritten as arrow-form switch expressiondescribeRegistrationEvent()_public static void main→void mainString.format()→String.formatted()This change was produced with Moderne CLI and Moderne Agent Tools (MCP).